package com.amadeus.commons.log.dao;

import java.net.UnknownHostException;

import com.mongodb.Mongo;
import com.mongodb.MongoException;

public class MongoDAOFactory extends DAOFactory {

	private static Mongo mongo;

	static {
		try {
			mongo = new Mongo("localhost", 27017);
			mongo.getDB("logexplorer").dropDatabase();
		} catch (UnknownHostException e) {
			e.printStackTrace();
		} catch (MongoException e) {
			e.printStackTrace();
		}
	}

	@Override
	public ExceptionInstanceDAO getExceptionInstanceDAO() {
		return MongoExceptionInstanceDAO.getInstance(mongo);
	}

	@Override
	public ErrorInstanceDAO getErrorInstanceDAO() {
		return MongoErrorInstanceDAO.getInstance(mongo);
	}

}
